<template>
    <d2-container>
      <el-date-picker
        v-model="value3"
        type="datetime"
        placeholder="选择日期时间"
        default-time="12:00:00">
      </el-date-picker>
      <el-button type="primary" @click="TimeTaskinfos()">查询</el-button>
      <div style="display:flex;flex-direction: column;margin-right:2%;">
        <h3>具体时间点内任务详情</h3>
        <el-table
          :data="timetaskinfo"
          border
          style="width: 100%">
          <el-table-column
            prop="id"
            align="center"
            label="序号">
          </el-table-column>
          <el-table-column
            prop="baby_id"
            align="center"
            label="宝贝ID">
          </el-table-column>
          <el-table-column
            prop="shop_name"
            align="center"
            label="店铺名称">
          </el-table-column>
          <el-table-column
            prop="key_word"
            align="center"
            label="关键词">
          </el-table-column>
          <el-table-column
            prop="tipsninfo"
            align="center"
            label="商家提示">
          </el-table-column>
          <el-table-column
            prop="picture_address"
            align="center"
            label="商品图片">
            <template slot-scope="scope">
              <Viewer>
                <img style="width:50px;" :src="scope.row.picture_address" alt="">
              </Viewer>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </d2-container>
</template>

<script>
  import {TimeTaskinfo} from "@/api/sys.login";
  export default {
    name: "index",
    data() {
      return {
        value3:new Date(new Date().getFullYear(),new Date().getMonth(),new Date().getDate(),new Date().getHours()),
        timetaskinfo:[]
      }
    },
    methods: {
      //具体时间点内任务详情
      TimeTaskinfos() {
        let params = {
          time: this.value3.getTime() / 1000
        }
        TimeTaskinfo(params).then(res => {
          this.timetaskinfo =res.data
        })
      }
    },
    created() {
      this.TimeTaskinfos()
    }
  }
</script>
